Structure peeling is a compiler optimization which modifies the data layout of structures to minimize the number of cache misses and to improve the program performance. Structure peeling is done in cases where certain set of fields are accessed frequently at different places in the program. Generally, structure peeling converts an array of structures (AOS) to structure of arrays (SOA). However some of the existing self-referential structure peeling strategies have limitations.
First, some existing self-referential structure peeling strategies are context sensitive and are limited in applicability to situations where only a single instance of AOS exists. Further, they are not applicable to situations where multiple instances of AOSs (all of same data type) exist with complex interconnectivity among them.
Second, some existing self-referential structure peeling strategies require memory pool management routines with special capabilities that ensures that all the SOA of a certain data type are all placed contiguously in memory. This can be achieved by reserving huge memory for all the AOSs of a specific data type, which could lead to inefficient use of memory and fragmentation. Alternatively, memory is allocated to a required size initially and then resized when required. However, this involves a large number of unnecessary memory move operations and this could degrade the runtime performance of the application.
Further, in some existing self-referential structure peeling strategies, associated field values may be placed at a large distance from each other. However, this could cause unnecessary page faults in certain situations and degrade the runtime performance of the application.
Thus, an improved approach to self-referential structure peeling may be desirable.